#include <stdio.h>
#include "globalComponents.h"


lv_obj_t * statusbar_GF9MTS8o_cont_cBy7XXRZ = NULL;
lv_obj_t * statusbar_GF9MTS8o_img_bLJ2mMkp = NULL;
lv_obj_t * statusbar_GF9MTS8o_img_sMbHm9TZ = NULL;
lv_obj_t * statusbar_GF9MTS8o_img_EGXZkbcG = NULL;
lv_obj_t * statusbar_GF9MTS8o_label_mccr8YKY = NULL;
static void statusbar_GF9MTS8o_img_bLJ2mMkp_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status);
static void statusbar_GF9MTS8o_img_EGXZkbcG_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status);
static void statusbar_GF9MTS8o_label_mccr8YKY_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status);
static void register_events(event_table_t *table);


static void statusbar_GF9MTS8o_img_bLJ2mMkp_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status) {
    switch (code) {
    case EVT_BT_CHANGED: {
        // Handle data
        switch (type) {
        case 0: {
            // No handling for void data type
            break;
        }
        case 1: {
            // img cannot accept boolean data
            break;
        }
        case 2: {
            // img cannot accept integer data
            break;
        }
        case 3: {
            // img cannot accept string data
            break;
        }
        default: {
            break;
        }
        }
        // Handle status
        switch (status) {
        case 0: {
            // Handle status 0
            lv_img_set_src(statusbar_GF9MTS8o_img_bLJ2mMkp, &no_bluetooth_20x20);
            break;
        }
        case 1: {
            // Handle status 1
            lv_img_set_src(statusbar_GF9MTS8o_img_bLJ2mMkp, &bluetooth_20x20);
            break;
        }
        default: {
            break;
        }
        }
        break;
    }
    default: {
        break;
    }
    }
}
static void statusbar_GF9MTS8o_img_EGXZkbcG_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status) {
    switch (code) {
    case EVT_BATTERY_CHANGED: {
        // Handle data
        switch (type) {
        case 0: {
            // No handling for void data type
            break;
        }
        case 1: {
            // img cannot accept boolean data
            break;
        }
        case 2: {
            // img cannot accept integer data
            break;
        }
        case 3: {
            // img cannot accept string data
            break;
        }
        default: {
            break;
        }
        }
        // Handle status
        switch (status) {
        case 0: {
            // Handle status 0
            lv_img_set_src(statusbar_GF9MTS8o_img_EGXZkbcG, &battery_0_20x20);
            break;
        }
        case 1: {
            // Handle status 1
            lv_img_set_src(statusbar_GF9MTS8o_img_EGXZkbcG, &battery_1_20x20);
            break;
        }
        case 2: {
            // Handle status 2
            lv_img_set_src(statusbar_GF9MTS8o_img_EGXZkbcG, &battery_2_20x20);
            break;
        }
        default: {
            break;
        }
        }
        break;
    }
    default: {
        break;
    }
    }
}
static void statusbar_GF9MTS8o_label_mccr8YKY_comm_event_handler(uint8_t event, uint16_t code, uint16_t type, uint16_t len, uint8_t * data, uint8_t status) {
    switch (code) {
    case EVT_TIME_CHANGED: {
        // Handle data
        switch (type) {
        case 0: {
            // No handling for void data type
            break;
        }
        case 1: {
            // label cannot accept boolean data
            break;
        }
        case 2: {
            // label cannot accept integer data
            break;
        }
        case 3: {
            // Handling String data for label
            char * value = lv_mem_alloc(len + 1);
            lv_memset_00(value, len + 1);
            lv_memcpy(value, data, len);
            lv_label_set_text(statusbar_GF9MTS8o_label_mccr8YKY, value);
            lv_mem_free(value);
            break;
        }
        default: {
            break;
        }
        }
        // Handle status
        break;
    }
    default: {
        break;
    }
    }
}
static void register_events(event_table_t *table) {
    register_event(table, EVT_TIME, EVT_TIME_CHANGED, 3, 64, statusbar_GF9MTS8o_label_mccr8YKY_comm_event_handler);
    register_event(table, EVT_BATTERY, EVT_BATTERY_CHANGED, 2, 1, statusbar_GF9MTS8o_img_EGXZkbcG_comm_event_handler);
    register_event(table, EVT_BT, EVT_BT_CHANGED, 1, 1, statusbar_GF9MTS8o_img_bLJ2mMkp_comm_event_handler);
}
lv_obj_t * lv_statusbar_create(lv_obj_t * parent) {
    lv_obj_t * statusbar_GF9MTS8o_statusbar_GF9MTS8o = lv_obj_create(parent);
    lv_obj_set_pos(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, 0);
    lv_obj_set_size(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, 30);
    lv_obj_set_style_pad_top(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(statusbar_GF9MTS8o_statusbar_GF9MTS8o, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    // Create statusbar_GF9MTS8o_cont_cBy7XXRZ
    statusbar_GF9MTS8o_cont_cBy7XXRZ = lv_obj_create(statusbar_GF9MTS8o_statusbar_GF9MTS8o);
    lv_obj_set_pos(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, 0);
    lv_obj_set_size(statusbar_GF9MTS8o_cont_cBy7XXRZ, 640, 30);
    lv_obj_set_scrollbar_mode(statusbar_GF9MTS8o_cont_cBy7XXRZ, LV_SCROLLBAR_MODE_OFF);
    // Add style for cont_cBy7XXRZ - LV_PART_MAIN | LV_STATE_DEFAULT
    lv_obj_set_style_bg_color(statusbar_GF9MTS8o_cont_cBy7XXRZ, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_color(statusbar_GF9MTS8o_cont_cBy7XXRZ, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(statusbar_GF9MTS8o_cont_cBy7XXRZ, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(statusbar_GF9MTS8o_cont_cBy7XXRZ, LV_GRAD_DIR_NONE, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(statusbar_GF9MTS8o_cont_cBy7XXRZ, lv_color_hex(0x2195f6), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(statusbar_GF9MTS8o_cont_cBy7XXRZ, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_radius(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_color(statusbar_GF9MTS8o_cont_cBy7XXRZ, lv_color_hex(0x2195f6), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_opa(statusbar_GF9MTS8o_cont_cBy7XXRZ, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_spread(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_ofs_x(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_ofs_y(statusbar_GF9MTS8o_cont_cBy7XXRZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    // Create statusbar_GF9MTS8o_img_bLJ2mMkp
    statusbar_GF9MTS8o_img_bLJ2mMkp = lv_img_create(statusbar_GF9MTS8o_statusbar_GF9MTS8o);
    lv_img_set_src(statusbar_GF9MTS8o_img_bLJ2mMkp, &bluetooth_20x20);
    lv_obj_set_pos(statusbar_GF9MTS8o_img_bLJ2mMkp, 560, 5);
    lv_obj_set_size(statusbar_GF9MTS8o_img_bLJ2mMkp, 20, 20);
    lv_obj_set_scrollbar_mode(statusbar_GF9MTS8o_img_bLJ2mMkp, LV_SCROLLBAR_MODE_OFF);
    lv_img_set_pivot(statusbar_GF9MTS8o_img_bLJ2mMkp, 50, 50);
    lv_img_set_angle(statusbar_GF9MTS8o_img_bLJ2mMkp, 0);
    // Add style for img_bLJ2mMkp - LV_PART_MAIN | LV_STATE_DEFAULT
    lv_obj_set_style_img_recolor(statusbar_GF9MTS8o_img_bLJ2mMkp, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_recolor_opa(statusbar_GF9MTS8o_img_bLJ2mMkp, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_opa(statusbar_GF9MTS8o_img_bLJ2mMkp, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    // Create statusbar_GF9MTS8o_img_sMbHm9TZ
    statusbar_GF9MTS8o_img_sMbHm9TZ = lv_img_create(statusbar_GF9MTS8o_statusbar_GF9MTS8o);
    lv_img_set_src(statusbar_GF9MTS8o_img_sMbHm9TZ, &WIFI_20x20);
    lv_obj_set_pos(statusbar_GF9MTS8o_img_sMbHm9TZ, 585, 5);
    lv_obj_set_size(statusbar_GF9MTS8o_img_sMbHm9TZ, 20, 20);
    lv_obj_set_scrollbar_mode(statusbar_GF9MTS8o_img_sMbHm9TZ, LV_SCROLLBAR_MODE_OFF);
    lv_img_set_pivot(statusbar_GF9MTS8o_img_sMbHm9TZ, 50, 50);
    lv_img_set_angle(statusbar_GF9MTS8o_img_sMbHm9TZ, 0);
    // Add style for img_sMbHm9TZ - LV_PART_MAIN | LV_STATE_DEFAULT
    lv_obj_set_style_img_recolor(statusbar_GF9MTS8o_img_sMbHm9TZ, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_recolor_opa(statusbar_GF9MTS8o_img_sMbHm9TZ, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_opa(statusbar_GF9MTS8o_img_sMbHm9TZ, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    // Create statusbar_GF9MTS8o_img_EGXZkbcG
    statusbar_GF9MTS8o_img_EGXZkbcG = lv_img_create(statusbar_GF9MTS8o_statusbar_GF9MTS8o);
    lv_img_set_src(statusbar_GF9MTS8o_img_EGXZkbcG, &battery_20x20);
    lv_obj_set_pos(statusbar_GF9MTS8o_img_EGXZkbcG, 610, 5);
    lv_obj_set_size(statusbar_GF9MTS8o_img_EGXZkbcG, 20, 20);
    lv_obj_set_scrollbar_mode(statusbar_GF9MTS8o_img_EGXZkbcG, LV_SCROLLBAR_MODE_OFF);
    lv_img_set_pivot(statusbar_GF9MTS8o_img_EGXZkbcG, 50, 50);
    lv_img_set_angle(statusbar_GF9MTS8o_img_EGXZkbcG, 0);
    // Add style for img_EGXZkbcG - LV_PART_MAIN | LV_STATE_DEFAULT
    lv_obj_set_style_img_recolor(statusbar_GF9MTS8o_img_EGXZkbcG, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_recolor_opa(statusbar_GF9MTS8o_img_EGXZkbcG, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_img_opa(statusbar_GF9MTS8o_img_EGXZkbcG, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    //Create statusbar_GF9MTS8o_label_mccr8YKY
    statusbar_GF9MTS8o_label_mccr8YKY = lv_label_create(statusbar_GF9MTS8o_statusbar_GF9MTS8o);
    lv_obj_set_pos(statusbar_GF9MTS8o_label_mccr8YKY, 10, 0);
    lv_obj_set_size(statusbar_GF9MTS8o_label_mccr8YKY, 80, 30);
    lv_obj_set_scrollbar_mode(statusbar_GF9MTS8o_label_mccr8YKY, LV_SCROLLBAR_MODE_OFF);
    lv_label_set_text(statusbar_GF9MTS8o_label_mccr8YKY, "12:00:00");
    lv_label_set_long_mode(statusbar_GF9MTS8o_label_mccr8YKY, LV_LABEL_LONG_WRAP);
    // Add style for label_mccr8YKY - LV_PART_MAIN | LV_STATE_DEFAULT
    lv_obj_set_style_bg_color(statusbar_GF9MTS8o_label_mccr8YKY, lv_color_hex(0x2095f5), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_color(statusbar_GF9MTS8o_label_mccr8YKY, lv_color_hex(0x2195f6), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(statusbar_GF9MTS8o_label_mccr8YKY, LV_GRAD_DIR_NONE, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_radius(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(statusbar_GF9MTS8o_label_mccr8YKY, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_color(statusbar_GF9MTS8o_label_mccr8YKY, lv_color_hex(0x2195f6), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_opa(statusbar_GF9MTS8o_label_mccr8YKY, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_spread(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_ofs_x(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_ofs_y(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(statusbar_GF9MTS8o_label_mccr8YKY, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(statusbar_GF9MTS8o_label_mccr8YKY, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(statusbar_GF9MTS8o_label_mccr8YKY, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(statusbar_GF9MTS8o_label_mccr8YKY, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(statusbar_GF9MTS8o_label_mccr8YKY, &lv_font_SourceHanSansSC_Normal_12, LV_PART_MAIN | LV_STATE_DEFAULT);
    event_table_t * event_table = get_current_event_table();
    register_events(event_table);
    return statusbar_GF9MTS8o_statusbar_GF9MTS8o;
}
